<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
   <%@page import="it.polimi.travelDream.ejb.servlet.*" %>
  <%@page import="it.polimi.travelDream.entities.Staff" %>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		  	TravelDreamRegistration
		</title>
		<link rel="stylesheet" type="text/css" href="style.css" />
  	</head>
  
  
  <body>
  	<div class="header">
  		 <ul>
  			<li>TravelDream</li>
		    Staff Registration
	    </ul>
  	</div> 	
  	
  	  	<div class="section">	    
	    <div class="nav">	    
		   	<ul>
	    		<li> <a href=StaffHome.jsp> Home  </a></li>
	    		<li > <a href="BPManagement.jsp">Manage BasicProducts</a></li>
	    		<li> <a href="PManagement.jsp">Manage Packages</a></li>
	    		<% 
	    		Staff z = new Staff(0,false,"0","0","0","0","0");
	      		if (request.getSession().getAttribute("utente")!=null )
		    	{ 
	      			z=(Staff)request.getSession().getAttribute("utente");
		        }
	      		else
	      		{
	      			
	      		}
	    		if (z.isPermission())
	    		{
	    			out.println("<li class=cur> Manage Staff</li>");
	    		}
		    	
	    
		    		%>
	    		<li> <a href=""> Logout </a></li>
	    	</ul>
	    </div>
	    
	    <div class="content">
	    <% 
	      if (request.getSession().getAttribute("utente")!=null )
		    	{ Staff u=(Staff)request.getSession().getAttribute("utente");
		    		System.out.println("ciao"+u.getId());
		    	
	    
		    		%>
	    	<form action="StaffRegistrationServlet" method="POST" id=form class=myform>
	    			<div class="spacer"></div>
	    			<fieldset>
	  					<legend>Registration:</legend>
	  						
	  						<div class="spacer"></div>
	  						
	  						<label>Name
								<span class="small">Your name</span>
							</label>
							<input type="text" name="name"  />
							
							<label>Surname
								<span class="small">Your name</span>
							</label>
							<input type="text" name="surname"  />

							<label>Username
								<span class="small">Your surname</span>
							</label>
							<input type="text" name="username" />  		    					
	    					
	    					<label>Password
								<span class="small">Your password</span>
							</label>
							<input type="password" name="password" />
	    		
	    					<label>Email
								<span class="small">Your email</span>
							</label>
							<input type="text" name="mail"  />
							
				    

				    			    
				    <input class=button type="submit" value="Register" />
			    
	    		   <% 
	    	if (request.getAttribute("message") == null) 
		    	{ 
		    		%>
						<div></div>
					<% 
				} 
	    	else 
		    	{ 
		    		%>
						<div class="advice"><%=request.getAttribute("message")%></div>
					<% 
				} 
		%>

    </div>
    <%
		} else { 
				response.sendRedirect("/TravelDreamSystemWeb/StaffLogin.jsp");
				%>
				
				
					<%
		}	
		%>
		</div>

 
    
    <div class="footer">
    	<ul>
	    	<li>TravelDream Company srl © All rights reserved</li>
		    <li>Terms of use | Contacts | Team </li>
	    </ul>
    </div>    
    
  </body>
</html>